** Make Figure 1: Time series showing percentage of middle-generation parents
** living in three-generation households
*******************************************************************************


use OrganizedParentLevelData


gen TimeForTimeSeries = .
replace TimeForTimeSeries = 1 if panel==1990 & swave==3
replace TimeForTimeSeries = 2 if panel==1990 & swave==4
replace TimeForTimeSeries = 3 if panel==1991 & swave==3
replace TimeForTimeSeries = 4 if panel==1991 & swave==7
replace TimeForTimeSeries = 5 if panel==1992 & swave==4
replace TimeForTimeSeries = 6 if panel==1992 & swave==6
replace TimeForTimeSeries = 7 if panel==1993 & swave==3
replace TimeForTimeSeries = 8 if panel==1993 & swave==6
replace TimeForTimeSeries = 9 if panel==1996 & swave==3
replace TimeForTimeSeries = 10 if panel==1996 & swave==6
replace TimeForTimeSeries = 11 if panel==1996 & swave==9
replace TimeForTimeSeries = 12 if panel==1996 & swave==12
replace TimeForTimeSeries = 13 if panel==2001 & swave==3
replace TimeForTimeSeries = 14 if panel==2001 & swave==6
replace TimeForTimeSeries = 15 if panel==2001 & swave==9
replace TimeForTimeSeries = 16 if panel==2004 & swave==3
replace TimeForTimeSeries = 17 if panel==2004 & swave==6
replace TimeForTimeSeries = 18 if panel==2008 & swave==4
replace TimeForTimeSeries = 19 if panel==2008 & swave==7
replace TimeForTimeSeries = 20 if panel==2008 & swave==10
replace TimeForTimeSeries = 21 if panel==2014 & swave==1
replace TimeForTimeSeries = 22 if panel==2014 & swave==2
replace TimeForTimeSeries = 23 if panel==2014 & swave==3
replace TimeForTimeSeries = 24 if panel==2014 & swave==4


keep TimeForTimeSeries ParentHasParent

collapse ParentHasParent, by(TimeForTimeSeries)
save DataFor3GenFigure, replace
clear



use OrganizedParentLevelData


gen TimeForTimeSeries = .
replace TimeForTimeSeries = 1 if panel==1990 & swave==3
replace TimeForTimeSeries = 2 if panel==1990 & swave==4
replace TimeForTimeSeries = 3 if panel==1991 & swave==3
replace TimeForTimeSeries = 4 if panel==1991 & swave==7
replace TimeForTimeSeries = 5 if panel==1992 & swave==4
replace TimeForTimeSeries = 6 if panel==1992 & swave==6
replace TimeForTimeSeries = 7 if panel==1993 & swave==3
replace TimeForTimeSeries = 8 if panel==1993 & swave==6
replace TimeForTimeSeries = 9 if panel==1996 & swave==3
replace TimeForTimeSeries = 10 if panel==1996 & swave==6
replace TimeForTimeSeries = 11 if panel==1996 & swave==9
replace TimeForTimeSeries = 12 if panel==1996 & swave==12
replace TimeForTimeSeries = 13 if panel==2001 & swave==3
replace TimeForTimeSeries = 14 if panel==2001 & swave==6
replace TimeForTimeSeries = 15 if panel==2001 & swave==9
replace TimeForTimeSeries = 16 if panel==2004 & swave==3
replace TimeForTimeSeries = 17 if panel==2004 & swave==6
replace TimeForTimeSeries = 18 if panel==2008 & swave==4
replace TimeForTimeSeries = 19 if panel==2008 & swave==7
replace TimeForTimeSeries = 20 if panel==2008 & swave==10
replace TimeForTimeSeries = 21 if panel==2014 & swave==1
replace TimeForTimeSeries = 22 if panel==2014 & swave==2
replace TimeForTimeSeries = 23 if panel==2014 & swave==3
replace TimeForTimeSeries = 24 if panel==2014 & swave==4

keep if NoParsWithCollege==1
keep TimeForTimeSeries ParentHasParent

collapse WithNoCollege_PHP = ParentHasParent, by(TimeForTimeSeries)
merge 1:1 TimeForTimeSeries using DataFor3GenFigure
drop _merge
save DataFor3GenFigure, replace
clear


use OrganizedParentLevelData

gen TimeForTimeSeries = .

replace TimeForTimeSeries = 1 if panel==1990 & swave==3
replace TimeForTimeSeries = 2 if panel==1990 & swave==4
replace TimeForTimeSeries = 3 if panel==1991 & swave==3
replace TimeForTimeSeries = 4 if panel==1991 & swave==7
replace TimeForTimeSeries = 5 if panel==1992 & swave==4
replace TimeForTimeSeries = 6 if panel==1992 & swave==6
replace TimeForTimeSeries = 7 if panel==1993 & swave==3
replace TimeForTimeSeries = 8 if panel==1993 & swave==6
replace TimeForTimeSeries = 9 if panel==1996 & swave==3
replace TimeForTimeSeries = 10 if panel==1996 & swave==6
replace TimeForTimeSeries = 11 if panel==1996 & swave==9
replace TimeForTimeSeries = 12 if panel==1996 & swave==12
replace TimeForTimeSeries = 13 if panel==2001 & swave==3
replace TimeForTimeSeries = 14 if panel==2001 & swave==6
replace TimeForTimeSeries = 15 if panel==2001 & swave==9
replace TimeForTimeSeries = 16 if panel==2004 & swave==3
replace TimeForTimeSeries = 17 if panel==2004 & swave==6
replace TimeForTimeSeries = 18 if panel==2008 & swave==4
replace TimeForTimeSeries = 19 if panel==2008 & swave==7
replace TimeForTimeSeries = 20 if panel==2008 & swave==10
replace TimeForTimeSeries = 21 if panel==2014 & swave==1
replace TimeForTimeSeries = 22 if panel==2014 & swave==2
replace TimeForTimeSeries = 23 if panel==2014 & swave==3
replace TimeForTimeSeries = 24 if panel==2014 & swave==4



keep if NoCollegeGradPars==1
keep TimeForTimeSeries ParentHasParent

collapse NoCollegeGrad_PHP = ParentHasParent, by(TimeForTimeSeries)
merge 1:1 TimeForTimeSeries using DataFor3GenFigure
drop _merge



graph twoway (scatter ParentHasParent TimeForTimeSeries) || (scatter WithNoCollege_PHP TimeForTimeSeries) || (scatter NoCollegeGrad_PHP TimeForTimeSeries) , scheme(s1mono) xtitle("Panel and Wave") ytitle("In 3-Generation Household") ylabel(0 (0.02) 0.12) xlabel(1 "1990, w3" 3 "1991, w3" 5 "1992, w4" 7 "1993, w3" 9 "1996, w3" 13 "2001, w3" 16 "2004, w3" 18 "2008, w4" 21 "2014, w1", angle(45)) legend(label(1 "All Parents") label(2 "No Parent Has College Exper") label(3 "No College Grad Parent"))
graph export Fig_ParentsIn3GenHHs_3lines.eps, replace

